<?php
// 本类由系统自动生成，仅供测试用途
class IndexAction extends Action {
    public function index(){
        $array['one'] = 10;
        $array['two'] = 2;
        $this->assign('array',$array);
        $this->display();
        
        // $DC=a("book")
        //  $DC->index()
	// $this->show('<style type="text/css">*{ padding: 0; margin: 0; } div{ padding: 4px 48px;} body{ background: #fff; font-family: "微软雅黑"; color: #333;} h1{ font-size: 100px; font-weight: normal; margin-bottom: 12px; } p{ line-height: 1.8em; font-size: 36px }</style><div style="padding: 24px 48px;"> <h1>:)</h1><p>欢迎使用 <b>ThinkPHP</b>！</p></div><script type="text/javascript" src="http://tajs.qq.com/stats?sId=9347272" charset="UTF-8"></script>','utf-8');
    //	echo "this is index controller";
//     	show();
//         $person = array(
//             1 => array(
//                 'name' => 'heaven',
//                 'age' => 23,
//                 'sex' => "man",
//             ),
//             2 => array(
//                 'name' => 'laozhe',
//                 'age' => 10,
//                 'sex' => 'girl',
//             ),
//             3 => array(
//                 'name' => 'lidan',
//                 'age' => 18,
//                 'sex' => 'man',
//             ),
//         );
//         $this->person = $person;
//     	$this->display();
//         //1
//         $user = M('user');
//         dump($user->select());
//         //2
//         $user = D('User');
//         echo $user->md5jiami('aaaaa');
//         dump($user->select());
// //         //3
//         $user = new CommonModel();
//         echo $user->md5jiami('aaaaa');
//         $user = D('Common');
//         echo "<br/>";
//         echo $user->md5jiami('aaaaa');
//         //4
//         $user = M();
//         dump($user->query('select * from user'));
//         dump($user->execute('update user set user_name = "zhw" where user_id = 3'));
        /*
         * order
         */
//         $where['user_id'] = 1;
//         $where = array(
//             'user_id' => 1,
//             'user_name' => 'heaven',
//         );
//         $data = M('user')->order('user_id asc')->select();
//         dump($data);
//         $this->display();
        /*
         * field
         */
        /* $data = M('user')->field('user_id')->order('user_id asc')->select();
        dump($data);
        $this->display(); */
        /*
         * limit and page
         */
        /* $data = M('user')
        ->order('user_id asc')
        ->limit(5)
        ->page(1)
        ->select();
        dump($data);
        $this->display(); */
        /*
         * group and having
         */
       /*  $data = M('User')
        ->field('user_score,count(*) as total')
        ->group('user_score')
        ->having('user_score>=25')
        ->select();
        dump($data);
        $this->display(); */
    }

    public function show(){
        echo "hello world";
    }

}